home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 2 / Tech Arsenal 2 (Arsenal Computer).iso / clipper / s93bsp.exe / QBTXTMAC.PRG < prev    next >
Encoding:
Text File  |  1992-04-02  |  760 b   |  32 lines

  1. *       Q B T X T M A C
  2. *       Procedure to read a text file each line of which is
  3. *       a series of macros to define how info should be printed
  4. *       uses clipper file reading facilities and
  5. *       Tom Rettig function atnext()
  6.  
  7. PARAMETERS fname
  8. PRIVATE buffer, occ, opos, npos, macline
  9. X=REPLICATE("A",1)
  10. a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"
  11. X=SUBSTR(A,1,1)
  12. y = chr(32)
  13. buffer = memoread(fname)
  14. STORE 1 TO occ, opos, npos
  15. set print on
  16. DO WHILE .T.
  17.     npos = atnext(chr(13),buffer,occ)
  18.     IF npos=0
  19.         EXIT
  20.     ENDIF
  21.     macline = substr(buffer,opos,npos-opos)
  22.  
  23.     IF substr(macline,1,1)<>"*"
  24.         ? &macline
  25.     ENDIF
  26.     opos = npos + 2
  27.     occ = occ + 1
  28. ENDDO
  29. set print off
  30. * eject
  31. RETURN
  32.